<?php

/**
 * Editionoptions form base class.
 *
 * @method Editionoptions getObject() Returns the current form's model object
 *
 * @package    briefing
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseEditionoptionsForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'ideditionoptions'     => new sfWidgetFormInputHidden(),
      'is_technical_terms'   => new sfWidgetFormInputCheckbox(),
      'is_foraign_word'      => new sfWidgetFormInputCheckbox(),
      'is_superlative'       => new sfWidgetFormInputCheckbox(),
      'is_old_language'      => new sfWidgetFormInputCheckbox(),
      'is_start_of_sentence' => new sfWidgetFormInputCheckbox(),
      'ownchoiceid'          => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Ownchoice'), 'add_empty' => true)),
      'moretext'             => new sfWidgetFormTextarea(),
    ));

    $this->setValidators(array(
      'ideditionoptions'     => new sfValidatorChoice(array('choices' => array($this->getObject()->get('ideditionoptions')), 'empty_value' => $this->getObject()->get('ideditionoptions'), 'required' => false)),
      'is_technical_terms'   => new sfValidatorBoolean(),
      'is_foraign_word'      => new sfValidatorBoolean(),
      'is_superlative'       => new sfValidatorBoolean(),
      'is_old_language'      => new sfValidatorBoolean(),
      'is_start_of_sentence' => new sfValidatorBoolean(),
      'ownchoiceid'          => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Ownchoice'), 'required' => false)),
      'moretext'             => new sfValidatorString(array('max_length' => 500, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('editionoptions[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Editionoptions';
  }

}
